<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateBindingRecordsTable extends Migration
{
    /**
     * 绑定记录表
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('binding_records', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->timestamps();

            $table->integer('user_id')->comment('用户id|');
            $table->tinyInteger('role')->comment('用户角色|1:客服,2:用户');
            $table->string('client_id')->comment('workmain临时id标识|');
            $table->string('source')->nullable()->default('')->comment('用户来源,默认为空string|数据表的名称');
            $table->softDeletes()->comment('软删除');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('binding_records');
    }
}
